<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function myFunction(str) {
		var r = confirm("是否删除此课程！");
		if (r == true) {
			$("#ddd").load('deletekc?id=' + str);
		} else {
			return false;
		}
	}
	$(function(){
		$('#id2').dialog({
			autoOpen:false,
			modal:true
		});
		$('#a1').click(function(){
			$('#id2').load('abc/addkc.jsp');
			$('#id2').dialog('open');
		});
	});
	function coursexg(id){
		$('#id2').load('xiugai?method=findkc&id='+id);
		$('#id2').dialog('open');
	}
</script>
<style type="text/css">
#a1{
	margin-top: 10px;
	margin-bottom: 5px;
}
</style>
<button type="button" id="a1" class="btn btn-primary btn btn-sm btn-lg bbb"><samp class="glyphicon glyphicon-plus"></samp>新增课程</button>
<table class="table table-bordered table-striped table-hover table-condensed">
	<tr>
		<td>课程</td>
		<td>课时</td>
		<td>操作</td>
	</tr>
<c:forEach items="${list}" var="a">
	<tr>
		<td>${a.course}</td>
		<td>${a.hour}</td>
		<td>
		<button type="button" onclick="coursexg(${a.id})" style="margin-right: 30px;" class="btn btn-primary btn btn-xs btn-lg bbb"><span class="glyphicon glyphicon-pencil"></span>修改</button>
		<button value="${a.id}" onclick="myFunction(this.value)" class="btn btn-primary btn btn-xs btn-lg bbb"><span class="glyphicon glyphicon-trash"></span>删除</button>		
		</td>
	</tr>
</c:forEach>
</table>
<div id="id2"></div>	